{extend name="apps/common/view/front.tpl" /}
<!--meta-->
{block name="header_meta"}
<title>DaiCuo菜单组件调用实例－{:config('common.site_name')}</title>
<meta name="keywords" content="DaiCuo标签组件" />
<meta name="description" content="呆错后台管理框架菜单组件数据调用开发实例。" />
{/block}
<!--header-->
{block name="header"}
  {include file="apps/common/view/widget/header.tpl" /}
{/block}
<!--main-->
{block name="main"}
<div class="container pt-2">
  <div class="card mb-3">
    <div class="card-header font-weight-bold">循环数据调用演示1</div>
    <div class="card-body">
      <blockquote>通过模板标签volist循环显示控制器已查询定义的数据列表。</blockquote>
      <ul class="card-text">
        {volist name="data" id="nav"}
        <li>{$nav.navs_id}-{$nav.navs_name}-{$nav.navs_slug}-{:DcUrl('example/nav/detail',['id'=>$nav['navs_id']])}</li>
        {/volist}
      </ul>
    </div>
  </div>
  <div class="card mb-3">
    <div class="card-header font-weight-bold">循环数据调用演示2</div>
    <div class="card-body">
      <blockquote>通过在模板里使用助手函数（DcTermNavbar）调用栏目分类循环数据。</blockquote>
      <ul class="card-text">
        {volist name=":DcTermNavbar(['result'=>'array','module'=>'example','type'=>'link','limit'=>10,'page'=>false,'sort'=>'term_id','order'=>'asc'])" id="nav"}
        <li>{$nav.navs_id}-{$nav.navs_name}-{$nav.navs_slug}-{:DcUrl('example/nav/detail',['id'=>$nav['navs_id']])}</li>
        {/volist}
      </ul>
    </div>
  </div>
  <div class="card mb-3">
    <div class="card-header d-flex justify-content-between">
      <font>控制器源码（apps/example/controller/Navs.php）</font>
      <a class="font-weight-bold text-purple" href="javascript:;" data-toggle="copy" data-clipboard-target="#controller">复制</a>
    </div>
    <div class="card-body" id="controller">
      {:exampleCode('apps/example/controller/Navs.php')}
    </div>
  </div>
  <div class="card mb-3">
    <div class="card-header d-flex justify-content-between">
      <font>模板源码（apps/example/theme/default/nasv/index.tpl）</font>
      <a class="font-weight-bold text-purple" href="javascript:;" data-toggle="copy" data-clipboard-target="#view">复制</a>
    </div>
    <div class="card-body" id="view">
      {:exampleCode('apps/example/theme/default/navs/index.tpl')}
    </div>
  </div>
</div>
{/block}
<!--footer-->
{block name="footer"}
  {include file="apps/common/view/widget/footer.tpl" /}
{/block}